home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / documents / RFC / rfc / rfc.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1996-11-11  |  2.2 KB  |  72 lines

  1. #!/bin/sh
  2. echo "   This script uses agrep, src for which is in ../../public/agrep"
  3. echo "\n"
  4. grepper='agrep -h -d$$ -i'
  5. oldIFS="$IFS"
  6. IFS=":$IFS"
  7. IFS="$oldIFS"
  8.  
  9. if [ -f /usr/people/4Dgifts/toolbox/documents/RFC/rfc-index.txt ]; then
  10.     RFC=/CDROM/documents/RFC
  11. fi
  12.  
  13. case "$RFC" in
  14. "")    echo "   Please set environment variable \"RFC\" to the current location"
  15.     echo "   of your RFC directory.  The Developer Toolbox CD is expecting"
  16.     echo "   this path to be \"/CDROM/documents/RFC\"."
  17.     echo "   To search in this directory using this \"rfc\" script, you will"
  18.     echo "   need to either umount the CD from wherever-it-is currently,"
  19.     echo "   then re-mount it under this mount point, or copy this 54+ MB "
  20.     echo "   dir to a local disk and then run"
  21.     echo "\n"
  22.     echo "setenv RFC \`pwd\`"
  23.     echo "\n"
  24.     echo "   after you cd to the local disk's directory location.  Then the"
  25.     echo "   \"rfc\" script will not bark at you.  An example of what it can"
  26.     echo "   produce wud be:"
  27.     echo "\n"
  28.     echo "< 118 ratmandu /documents/RFC> rfc 'protocol;multicast'"
  29.     echo "   This script uses agrep, src for which is in ../../public/agrep"
  30.            echo "\n"
  31.     echo "grepping..."
  32.     echo ""
  33.     echo "1458  Braudes, R.; Zabele, S.  Requirements for Multicast Protocols (Not"
  34.     echo "      online)  1993 May; 19 p. (Format: TXT=48107 bytes)"
  35.     echo ""
  36.     echo "1301  Armstrong, S.; Freier, A.; Marzullo, K.  Multicast Transport Protocol."
  37.     echo "      February 1992; 38 p. (Format: TXT=91977 bytes)"
  38.     echo ""
  39.     echo "1075  Waitzman, D.; Partridge, C.; Deering, S.  Distance Vector Multicast"
  40.     echo "      Routing Protocol.  1988 November; 24 p. (Format: TXT=54731 bytes)"
  41.     echo ""
  42.     echo "966   Deering, S.; Cheriton, D.  Host Groups: A Multicast Extension to the"
  43.     echo "      Internet Protocol.  1985 December; 27 p. (Format: TXT=61006 bytes)"
  44.     echo "      (Obsoleted by RFC 988)"
  45.     echo ""
  46.     exit
  47. esac
  48.  
  49. case "$1" in
  50. "")
  51.     echo 'usage: rfc <number>'
  52.     echo '       will display RFC <number> with "more" (or your $PAGER)'
  53.     echo ''
  54.     echo '       rfc <pattern>'
  55.     echo '       will egrep [agrep] for <pattern> in the file "rfc-index"'
  56.     echo ''
  57.     ;;
  58. [0-9]*)
  59.     list=
  60.     for i
  61.     do 
  62.         list="$list $RFC/rfc$i.*"
  63.     done
  64.     exec ${PAGER:-more} $list
  65.     ;;
  66. *)
  67.     echo grepping...
  68.     exec sed -e 's/^  *$//' $RFC/rfc-index.txt | $grepper "$@"
  69. esac
  70.  
  71.  
  72.